From 3140b13b50aaf89b2616fb6b0d4c24350026dd0e Mon Sep 17 00:00:00 2001 From: "twilkie@paploo.uk.xensource.com" Date: Thu, 11 Aug 2005 12:06:32 +0000 Subject: [PATCH] Added support for abbreviated xm sub commands --- tools/python/xen/xm/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index c1779d33a2..cbdbb1c0e8 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -605,6 +605,10 @@ def xm_lookup_cmd(cmd): deprecated(cmd,aliases[cmd]) return commands[aliases[cmd]] else: + if len( cmd ) > 1: + matched_commands = filter( lambda (command, func): command[ 0:len(cmd) ] == cmd, commands.iteritems() ) + if len( matched_commands ) == 1: + return matched_commands[0][1] err('Sub Command %s not found!' % cmd) usage() -- 2.30.2